<!DOCTYPE html>


<html lang="en">
  

    <head>
      <meta charset="utf-8" />
        
      <meta
        name="viewport"
        content="width=device-width, initial-scale=1, maximum-scale=1"
      />
      <title>GBase8s关于DBSpaces自动扩容的测试 |  朝花夕拾</title>
  <meta name="generator" content="hexo-theme-ayer">
      
      <link rel="shortcut icon" href="/ww.ico" />
       
<link rel="stylesheet" href="/dist/main.css">

      
<link rel="stylesheet" href="/css/fonts/remixicon.css">

      
<link rel="stylesheet" href="/css/custom.css">
 
      <script src="https://cdn.staticfile.org/pace/1.2.4/pace.min.js"></script>
       
 

      <link
        rel="stylesheet"
        href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-bulma@5.0.1/bulma.min.css"
      />
      <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.19/dist/sweetalert2.min.js"></script>

      <!-- mermaid -->
      
      <style>
        .swal2-styled.swal2-confirm {
          font-size: 1.6rem;
        }
      </style>
    </head>
  </html>
</html>


<body>
  <div id="app">
    
      
    <main class="content on">
      <section class="outer">
  <article
  id="post-GBase8s关于DBSpaces自动扩容的测试"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h1 class="article-title sea-center" style="border-left:0" itemprop="name">
  GBase8s关于DBSpaces自动扩容的测试
</h1>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/2023/05/10/GBase8s%E5%85%B3%E4%BA%8EDBSpaces%E8%87%AA%E5%8A%A8%E6%89%A9%E5%AE%B9%E7%9A%84%E6%B5%8B%E8%AF%95/" class="article-date">
  <time datetime="2023-05-10T01:28:11.000Z" itemprop="datePublished">2023-05-10</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/GBase8s/">GBase8s</a>
  </div>
  
<div class="word_count">
    <span class="post-time">
        <span class="post-meta-item-icon">
            <i class="ri-quill-pen-line"></i>
            <span class="post-meta-item-text"> Word count:</span>
            <span class="post-count">3.1k</span>
        </span>
    </span>

    <span class="post-time">
        &nbsp; | &nbsp;
        <span class="post-meta-item-icon">
            <i class="ri-book-open-line"></i>
            <span class="post-meta-item-text"> Reading time≈</span>
            <span class="post-count">15 min</span>
        </span>
    </span>
</div>
 
    </div>
      
    <div class="tocbot"></div>




  
    <div class="article-entry" itemprop="articleBody">
       
  <h2 id="自动扩容参数"><a href="#自动扩容参数" class="headerlink" title="自动扩容参数"></a>自动扩容参数</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">##################################################################</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">Storage Provisioning Parameters</span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">##################################################################</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">SP_AUTOEXPAND - When <span class="built_in">set</span> to 1, GBase will automatically <span class="built_in">expand</span> spaces</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">                that are low on or out of free pages. Set this param</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">                to 0 to <span class="built_in">disable</span> automatic chunk extensions and chunk</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">                additions.</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">                Default value is 1 (enabled).</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">SP_THRESHOLD  - Minimum amount of free space <span class="keyword">in</span> a DBspace, BLOBspace,</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">                or Smart BLOBspace before the space will automatically</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">                be expanded. Value is a decimal, and can be an absolute</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">                number of kilobytes or a percentage of the total size</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">                <span class="keyword">in</span> the DBspace.</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">                Default value is 0, <span class="built_in">which</span> effectively disables this</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">                proactive storage provisioning trigger.</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">SP_WAITTIME   - Access to the storage pool is serialized. When one thread</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">                is accessing the storage pool, SP_WAITIME is the number of</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">                seconds another thread will <span class="built_in">wait</span> before giving up on</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">                its own access.</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">                Default value is 30.</span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">###################################################################</span></span></span><br><span class="line"></span><br><span class="line">SP_AUTOEXPAND 1</span><br><span class="line">SP_THRESHOLD 0</span><br><span class="line">SP_WAITTIME 30</span><br></pre></td></tr></table></figure>

<p>中文翻译：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">##################################################################</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">存储发放参数</span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">##################################################################</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">SP_AUTOEXPAND -当设置为1时，GBase将自动扩展空闲页面上或空闲页面外的低空间。将此参数设置为0以禁用自动块扩展和块添加。</span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">默认值为1(启用)。</span></span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">SP_THRESHOLD - DBspace、BLOBspace或Smart BLOBspace在空间自动扩展之前的最小可用空间量。Value是一个小数，可以是千字节的绝对值(单位K)，也可以是DBspace中总大小的百分比。</span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">默认值为0，这有效地禁用了这个主动存储供应触发器。</span></span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">SP_WAITTIME -对存储池的访问是序列化的。当一个线程正在访问存储池时，SP_WAITIME是另一个线程在放弃自己的访问之前等待的秒数。</span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">默认值为30。</span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment">###################################################################</span></span></span><br></pre></td></tr></table></figure>

<p>扩展SP_THRESHOLD:</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">onconfig.std value</span><br><span class="line">    SP_THRESHOLD 0</span><br><span class="line">values</span><br><span class="line">    0 = No threshold. The trigger that runs the storage space monitoring (mon_low_storage) task for adding space when space is below the threshold is disabled.</span><br><span class="line"></span><br><span class="line">    1 - 50 = A threshold that is a percentage of free kilobytes in a storage space.</span><br><span class="line"></span><br><span class="line">    If the value is 50 or below, Informix interprets the value as a percentage (for example, 10 = 10 percent and 2.84 = 2.84 percent).</span><br><span class="line"></span><br><span class="line">    1000 to the maximum size of a chunk = A threshold that is either 1000 kilobytes or the maximum size of the chunk on the current platform.</span><br><span class="line"></span><br><span class="line">    If the value is 1000 or higher, Informix interprets the value as a specific number of kilobytes.</span><br><span class="line"></span><br><span class="line">    Values 50 - 1000 are not valid.</span><br><span class="line">takes effect</span><br><span class="line">    After you edit your onconfig file and restart the database server.</span><br><span class="line">    When you reset the value dynamically in your onconfig file by running the onmode -wf command.</span><br><span class="line">    When you reset the value in memory by running the onmode -wm command.</span><br><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p>扩展SP_THRESHOLD中文翻译：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">#</span><span class="language-bash">SP_THRESHOLD 0</span></span><br><span class="line"></span><br><span class="line">0 =无阈值。当空间低于阈值时，运行存储空间监控(mon_low_storage)任务(用于添加空间)的触发器被禁用。</span><br><span class="line"></span><br><span class="line">1 - 50 =一个阈值，它是存储空间中可用千字节的百分比。</span><br><span class="line"></span><br><span class="line">50 - 1000无效。</span><br><span class="line"></span><br><span class="line">1000-CHUNK最大值 =一个阈值，该阈值为1000千字节或当前平台上CHUNK的最大大小。</span><br><span class="line">如果该值为1000或更高，Informix将该值解释为特定的千字节数。</span><br><span class="line"></span><br></pre></td></tr></table></figure>



<h2 id="个人小结"><a href="#个人小结" class="headerlink" title="个人小结"></a>个人小结</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">SP_AUTOEXPAND 1 </span><br><span class="line">SP_THRESHOLD 0</span><br><span class="line">SP_WAITTIME 30</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">开启存储发放，关闭空间监控和空间监控触发的扩容。如果其他空间真在扩容，最大等待30秒。</span></span><br></pre></td></tr></table></figure>



<h2 id="存储发放测试1：-SP-THRESHOLD-0"><a href="#存储发放测试1：-SP-THRESHOLD-0" class="headerlink" title="存储发放测试1： SP_THRESHOLD 0"></a>存储发放测试1： SP_THRESHOLD 0</h2><h3 id="参数"><a href="#参数" class="headerlink" title="参数"></a>参数</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">SP_AUTOEXPAND 1 </span><br><span class="line">SP_THRESHOLD 0</span><br><span class="line">SP_WAITTIME 30</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">开启存储发放，关闭空间监控和空间监控触发的扩容。如果其他空间真正扩容，最大等待30秒。</span></span><br></pre></td></tr></table></figure>

<h3 id="创建10M的DBS：dbs10"><a href="#创建10M的DBS：dbs10" class="headerlink" title="创建10M的DBS：dbs10"></a>创建10M的DBS：dbs10</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">touch /home/gbasedbt/dbs10330</span><br><span class="line">chmod 660 /home/gbasedbt/dbs10330</span><br><span class="line">onspaces -c -d dbs10 -p /home/gbasedbt/dbs10330 -o 0 -s 10240 </span><br></pre></td></tr></table></figure>

<h3 id="创建数据库存在其上：-db10"><a href="#创建数据库存在其上：-db10" class="headerlink" title="创建数据库存在其上：  db10"></a>创建数据库存在其上：  db10</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">dbaccess sysmaster &lt;&lt;!</span><br><span class="line">	create database db10 in dbs10;</span><br><span class="line">!</span><br></pre></td></tr></table></figure>

<h3 id="创建测试表：-t"><a href="#创建测试表：-t" class="headerlink" title="创建测试表： t"></a>创建测试表： t</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">dbaccess db10 &lt;&lt;!</span><br><span class="line">	drop table if exists t;</span><br><span class="line">    create table t(</span><br><span class="line">    id   serial not null,</span><br><span class="line">    col1 datetime year to second default current year to second,</span><br><span class="line">    col2 char(200),</span><br><span class="line">    col3 varchar(200),</span><br><span class="line">    primary key(id)</span><br><span class="line">);</span><br><span class="line">!</span><br></pre></td></tr></table></figure>

<h3 id="在测试表里插入大量数据："><a href="#在测试表里插入大量数据：" class="headerlink" title="在测试表里插入大量数据："></a>在测试表里插入大量数据：</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">dbaccess db10 &lt;&lt;!</span><br><span class="line">drop procedure if exists insert_t;</span><br><span class="line">create procedure insert_t()</span><br><span class="line">	define i int;</span><br><span class="line">	for i=1 to 30000</span><br><span class="line">		insert into t(col2,col3) values (&#x27;zgCdw31DZpyToUdqrszWXt8FDBZ7dkBUdX8liWERZzgCdw31DZpyToUdqrszWXt8FDBZ7dkBUdX8liWERZzgCdw31DZpyToUdqrszWXt8FDBZ7dkBUdX8liWERZzgCdw31DZpyToUdqrszWXt8FDBZ7dkBUdX8liWERZzgCdw31DZpyToUdqrszWXt8FDBZ7dkBUdX8l&#x27;,&#x27;7dkBUdX8liWERZzgCdw31DZpyToUdqrszWXt8F&#x27;);</span><br><span class="line">	end for;</span><br><span class="line">end procedure;</span><br><span class="line">call insert_t();</span><br><span class="line">!</span><br></pre></td></tr></table></figure>

<h3 id="插入过程会失败：报错131"><a href="#插入过程会失败：报错131" class="headerlink" title="插入过程会失败：报错131"></a>插入过程会失败：报错131</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">  271: 不能将新行插入表内。</span><br><span class="line"></span><br><span class="line">  131: ISAM 错误：没有可用磁盘空间</span><br><span class="line">错误在 1 行</span><br><span class="line">第 1 字符</span><br></pre></td></tr></table></figure>

<h3 id="再次插入：还是报错131"><a href="#再次插入：还是报错131" class="headerlink" title="再次插入：还是报错131"></a>再次插入：还是报错131</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">dbaccess db10 &lt;&lt;!</span><br><span class="line">	create table t1 (id int);</span><br><span class="line">	insert into t1 values(1);</span><br><span class="line">!</span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">12:34:06  WARNING: DBspace dbs10 is full</span><br><span class="line">12:34:06  Process exited with return code 127: /bin/sh /bin/sh -c /opt/install/g300/etc/alarmprogram.sh 3 44 &quot;DBSpace is full: &#x27;dbs10&#x27;&quot; </span><br><span class="line">&quot;WARNING: DBspace dbs10 is full&quot; &quot;&quot; 44001</span><br><span class="line">12:35:25  Checkpoint Completed:  duration was 0 seconds.</span><br></pre></td></tr></table></figure>

<h3 id="测试结果："><a href="#测试结果：" class="headerlink" title="测试结果："></a>测试结果：</h3><p>​		空间满报错，不能插入。</p>
<h2 id="存储发放测试2：SP-THRESHOLD-10"><a href="#存储发放测试2：SP-THRESHOLD-10" class="headerlink" title="存储发放测试2：SP_THRESHOLD 10"></a>存储发放测试2：SP_THRESHOLD 10</h2><h3 id="参数调整"><a href="#参数调整" class="headerlink" title="参数调整"></a>参数调整</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">SP_AUTOEXPAND 1 </span><br><span class="line">SP_THRESHOLD 10</span><br><span class="line">SP_WAITTIME 30</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">开启存储发放，关闭空间监控和空间监控触发的扩容。如果其他空间真正扩容，最大等待30秒。</span></span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">onmode -wf SP_THRESHOLD=10</span><br></pre></td></tr></table></figure>

<p>注明：测发现对之前已经满了的dbs没有效果，插入还是报错。</p>
<h3 id="创建10M的DBS：dbs106"><a href="#创建10M的DBS：dbs106" class="headerlink" title="创建10M的DBS：dbs106"></a>创建10M的DBS：dbs106</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">touch /home/gbasedbt/dbs106</span><br><span class="line">chmod 660 /home/gbasedbt/dbs106</span><br><span class="line">onspaces -c -d dbs106 -p /home/gbasedbt/dbs106 -o 0 -s 10240 </span><br></pre></td></tr></table></figure>

<h3 id="创建数据库存在其上：-db106"><a href="#创建数据库存在其上：-db106" class="headerlink" title="创建数据库存在其上：  db106"></a>创建数据库存在其上：  db106</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">dbaccess sysmaster &lt;&lt;!</span><br><span class="line">	create database db106 in dbs106;</span><br><span class="line">!</span><br></pre></td></tr></table></figure>

<h3 id="创建测试表：-t-1"><a href="#创建测试表：-t-1" class="headerlink" title="创建测试表： t"></a>创建测试表： t</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">dbaccess db106 &lt;&lt;!</span><br><span class="line">	drop table if exists t;</span><br><span class="line">    create table t(</span><br><span class="line">    id   serial not null,</span><br><span class="line">    col1 datetime year to second default current year to second,</span><br><span class="line">    col2 char(200),</span><br><span class="line">    col3 varchar(200),</span><br><span class="line">    primary key(id)</span><br><span class="line">    );</span><br><span class="line">!</span><br></pre></td></tr></table></figure>

<h3 id="在测试表里插入大量数据：-1"><a href="#在测试表里插入大量数据：-1" class="headerlink" title="在测试表里插入大量数据："></a>在测试表里插入大量数据：</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">dbaccess db106 &lt;&lt;!</span><br><span class="line">drop procedure if exists insert_t;</span><br><span class="line">create procedure insert_t()</span><br><span class="line">	define i int;</span><br><span class="line">	for i=1 to 30000</span><br><span class="line">		insert into t(col2,col3) values (&#x27;zgCdw31DZpyToUdqrszWXt8FDBZ7dkBUdX8liWERZzgCdw31DZpyToUdqrszWXt8FDBZ7dkBUdX8liWERZzgCdw31DZpyToUdqrszWXt8FDBZ7dkBUdX8liWERZzgCdw31DZpyToUdqrszWXt8FDBZ7dkBUdX8liWERZzgCdw31DZpyToUdqrszWXt8FDBZ7dkBUdX8l&#x27;,&#x27;7dkBUdX8liWERZzgCdw31DZpyToUdqrszWXt8F&#x27;);</span><br><span class="line">	end for;</span><br><span class="line">end procedure;</span><br><span class="line">call insert_t();</span><br><span class="line">!</span><br></pre></td></tr></table></figure>

<h3 id="插入过程会失败：报错131-1"><a href="#插入过程会失败：报错131-1" class="headerlink" title="插入过程会失败：报错131"></a>插入过程会失败：报错131</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">  271: 不能将新行插入表内。</span><br><span class="line"></span><br><span class="line">  131: ISAM 错误：没有可用磁盘空间</span><br><span class="line">错误在 1 行</span><br><span class="line">第 1 字符</span><br></pre></td></tr></table></figure>

<h3 id="再次插入：还是报错131-1"><a href="#再次插入：还是报错131-1" class="headerlink" title="再次插入：还是报错131"></a>再次插入：还是报错131</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">dbaccess db106 &lt;&lt;!</span><br><span class="line">	create table t1 (id int);</span><br><span class="line">	insert into t1 values(1);</span><br><span class="line">!</span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">12:34:06  WARNING: DBspace dbs10 is full</span><br><span class="line">12:34:06  Process exited with return code 127: /bin/sh /bin/sh -c /opt/install/g300/etc/alarmprogram.sh 3 44 &quot;DBSpace is full: &#x27;dbs10&#x27;&quot; </span><br><span class="line">&quot;WARNING: DBspace dbs10 is full&quot; &quot;&quot; 44001</span><br><span class="line">12:35:25  Checkpoint Completed:  duration was 0 seconds.</span><br></pre></td></tr></table></figure>

<h3 id="测试结果：-1"><a href="#测试结果：-1" class="headerlink" title="测试结果："></a>测试结果：</h3><p>​		测试发现对新建的dbs也没有效果，插入还是报错。</p>
<p>​		发现sysadmin么有启动。</p>
<h2 id="存储发放测试3：启用sysadmin"><a href="#存储发放测试3：启用sysadmin" class="headerlink" title="存储发放测试3：启用sysadmin"></a>存储发放测试3：启用sysadmin</h2><h3 id="启用sysadmin"><a href="#启用sysadmin" class="headerlink" title="启用sysadmin"></a>启用sysadmin</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">rm $GBASEDBTDIR/etc/sysadmin/stop</span><br><span class="line">onmode -ky ; </span><br><span class="line">sleep 3;</span><br><span class="line">oninit -v;</span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">95       4b61cb50         474ae868         1    sleeping secs: 285      9cpu         dbScheduler</span><br><span class="line">96       4b67b028         474adfa8         1    sleeping forever        9cpu         dbWorker1</span><br><span class="line">97       4b410028         474af128         1    sleeping forever        9cpu         dbWorker2</span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">12:59:51  WARNING: DBspace dbs10 is full</span><br><span class="line">12:59:51  Process exited with return code 127: /bin/sh /bin/sh -c /opt/install/g300/etc/alarmprogram.sh 3 44 &quot;DBSpace is full: &#x27;dbs10&#x27;&quot; </span><br><span class="line">&quot;WARNING: DBspace dbs10 is full&quot; &quot;&quot; 44001</span><br><span class="line">13:00:23  Loading Module &lt;$GBASEDBTDIR/extend/ifxmngr/ifxmngr.bld&gt;</span><br><span class="line">13:00:23  pid 2316: can&#x27;t get real path of linux-vdso.so.1</span><br><span class="line">13:00:23  pid 2316: ELF .eh_frame section missing in /opt/install/g300/gls/dll/64-libicudata.so.48</span><br><span class="line">13:00:23  The C Language Module &lt;/opt/install/g300/extend/ifxmngr/ifxmngr.bld&gt; loaded</span><br><span class="line">13:02:41  Audit trail switched to /home/gbasedbt/audit_log/g300.28</span><br><span class="line">13:02:41  Process exited with return code 127: /bin/sh /bin/sh -c /opt/install/g300/etc/alarmprogram.sh 2 72 &quot;Audit trail switched to Audit&quot; &quot;Audit trail switched to /home/gbasedbt/audit_log/g300.28&quot; &quot;&quot; 72001</span><br><span class="line">13:02:50  WARNING: DBspace dbs106 is full</span><br><span class="line">13:02:50  Process exited with return code 127: /bin/sh /bin/sh -c /opt/install/g300/etc/alarmprogram.sh 3 44 &quot;DBSpace is full: &#x27;dbs106&#x27;&quot; &quot;WARNING: DBspace dbs106 is full&quot; &quot;&quot; 44001</span><br></pre></td></tr></table></figure>



<h3 id="测试结果：-2"><a href="#测试结果：-2" class="headerlink" title="测试结果："></a>测试结果：</h3><p>​		测试发现插入还是报错空间满了。</p>
<h2 id="存储发放测试4：把dbs创建到和rootdbs同目录下试试"><a href="#存储发放测试4：把dbs创建到和rootdbs同目录下试试" class="headerlink" title="存储发放测试4：把dbs创建到和rootdbs同目录下试试"></a>存储发放测试4：把dbs创建到和rootdbs同目录下试试</h2><h3 id="把dbs创建到和rootdbs同目录下试试"><a href="#把dbs创建到和rootdbs同目录下试试" class="headerlink" title="把dbs创建到和rootdbs同目录下试试"></a>把dbs创建到和rootdbs同目录下试试</h3><h3 id="创建10M的DBS：dbs10-1"><a href="#创建10M的DBS：dbs10-1" class="headerlink" title="创建10M的DBS：dbs10"></a>创建10M的DBS：dbs10</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">touch /data/g300/rootchkdbs</span><br><span class="line">chmod 660 /data/g300/rootchkdbs</span><br><span class="line">onspaces -c -d dbs10r -p /data/g300/rootchkdbs -o 0 -s 10240 </span><br></pre></td></tr></table></figure>

<h3 id="创建数据库存在其上：-db10-1"><a href="#创建数据库存在其上：-db10-1" class="headerlink" title="创建数据库存在其上：  db10"></a>创建数据库存在其上：  db10</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">dbaccess sysmaster &lt;&lt;!</span><br><span class="line">	create database db10r in dbs10r;</span><br><span class="line">!</span><br></pre></td></tr></table></figure>

<h3 id="创建测试表：-t-2"><a href="#创建测试表：-t-2" class="headerlink" title="创建测试表： t"></a>创建测试表： t</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">dbaccess db10r &lt;&lt;!</span><br><span class="line">	drop table if exists t;</span><br><span class="line">    create table t(</span><br><span class="line">    id   serial not null,</span><br><span class="line">    col1 datetime year to second default current year to second,</span><br><span class="line">    col2 char(200),</span><br><span class="line">    col3 varchar(200),</span><br><span class="line">    primary key(id)</span><br><span class="line">);</span><br><span class="line">!</span><br></pre></td></tr></table></figure>

<h3 id="在测试表里插入大量数据：-2"><a href="#在测试表里插入大量数据：-2" class="headerlink" title="在测试表里插入大量数据："></a>在测试表里插入大量数据：</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">dbaccess db10r &lt;&lt;!</span><br><span class="line">drop procedure if exists insert_t;</span><br><span class="line">create procedure insert_t()</span><br><span class="line">	define i int;</span><br><span class="line">	for i=1 to 30000</span><br><span class="line">		insert into t(col2,col3) values (&#x27;zgCdw31DZpyToUdqrszWXt8FDBZ7dkBUdX8liWERZzgCdw31DZpyToUdqrszWXt8FDBZ7dkBUdX8liWERZzgCdw31DZpyToUdqrszWXt8FDBZ7dkBUdX8liWERZzgCdw31DZpyToUdqrszWXt8FDBZ7dkBUdX8liWERZzgCdw31DZpyToUdqrszWXt8FDBZ7dkBUdX8l&#x27;,&#x27;7dkBUdX8liWERZzgCdw31DZpyToUdqrszWXt8F&#x27;);</span><br><span class="line">	end for;</span><br><span class="line">end procedure;</span><br><span class="line">call insert_t();</span><br><span class="line">!</span><br></pre></td></tr></table></figure>

<h3 id="插入过程会失败：报错131-2"><a href="#插入过程会失败：报错131-2" class="headerlink" title="插入过程会失败：报错131"></a>插入过程会失败：报错131</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">  271: 不能将新行插入表内。</span><br><span class="line"></span><br><span class="line">  131: ISAM 错误：没有可用磁盘空间</span><br><span class="line">错误在 1 行</span><br><span class="line">第 1 字符</span><br></pre></td></tr></table></figure>

<h3 id="测试结果：-3"><a href="#测试结果：-3" class="headerlink" title="测试结果："></a>测试结果：</h3><p>​		空间满报错，不能插入。</p>
<hr>
<h2 id="故障点1：-需要先配置存储池，才能启用自动扩容（文件系统chunk除外）。"><a href="#故障点1：-需要先配置存储池，才能启用自动扩容（文件系统chunk除外）。" class="headerlink" title="故障点1： 需要先配置存储池，才能启用自动扩容（文件系统chunk除外）。"></a>故障点1： 需要先配置存储池，才能启用自动扩容（文件系统chunk除外）。</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">13:37:08  SCHAPI Estimate succeeded for table &#x27;db10:&quot;gbasedbt&quot;. t&#x27; partnum a00047. </span><br><span class="line">13:37:08  admin_fragment_command(&#x27;fragment estimate_compression &#x27;,&#x27;10485831&#x27;) succeeded </span><br><span class="line">13:37:16  Warning: The storage pool is out of space. To enable automatic chunk  creation use the OpenAdmin Tool to add space to the pool. </span><br><span class="line">13:37:17  WARNING: DBspace dbs10 is full </span><br><span class="line">13:37:17  Process exited with return code 127: /bin/sh /bin/sh -c /opt/install/g330/etc/alarmprogram.sh 3 78 &quot;Warning: The storage pool is out of space. To enable automatic chunk </span><br><span class="line">          creation use the OpenAdmin Tool to add space to the pool.&quot; &quot;Warning: The storage pool is out of space. To enable automatic chunk </span><br><span class="line">          creation use the OpenAdmin Tool to add space to the pool.&quot; &quot;&quot; 78001 </span><br><span class="line">13:37:17  Process exited with return code 127: /bin/sh /bin/sh -c /opt/install/g330/etc/alarmprogram.sh 3 44 &quot;DBSpace is full: &#x27;dbs10&#x27;&quot; &quot;WARNING: DBspace dbs10 is full&quot; &quot;&quot; 44001 </span><br><span class="line">13:37:49  Loading Module &lt;$GBASEDBTDIR/extend/ifxmngr/ifxmngr.bld&gt; </span><br><span class="line">13:37:49  pid 2689: can&#x27;t get real path of linux-vdso.so.1 </span><br><span class="line">13:37:49  pid 2689: ELF .eh_frame section missing in /opt/install/g330/gls/dll/64-libicudata.so.48 </span><br><span class="line">13:37:50  The C Language Module &lt;/opt/install/g330/extend/ifxmngr/ifxmngr.bld&gt; loaded</span><br></pre></td></tr></table></figure>



<h2 id="故障点2：-chunk需要标记为可扩展"><a href="#故障点2：-chunk需要标记为可扩展" class="headerlink" title="故障点2： chunk需要标记为可扩展"></a>故障点2： chunk需要标记为可扩展</h2><hr>
<h2 id="请参考官方文档"><a href="#请参考官方文档" class="headerlink" title="请参考官方文档"></a>请参考官方文档</h2><p><a target="_blank" rel="noopener" href="https://www.ibm.com/docs/en/informix-servers/12.10?topic=management-marking-chunk-as-extendable-not-extendable">修改chunk可自动扩容</a></p>
<p><a target="_blank" rel="noopener" href="https://www.ibm.com/docs/en/informix-servers/12.10?topic=management-manually-expanding-space-extending-extendable-chunk#ids_admin_1368">扩容dbs或扩容chunk的API</a></p>
<p><a target="_blank" rel="noopener" href="https://www.ibm.com/docs/en/informix-servers/12.10?topic=space-automatic-management">INFORMIX自动空间管理 指导</a></p>
<h2 id="存款发放测试5："><a href="#存款发放测试5：" class="headerlink" title="存款发放测试5："></a>存款发放测试5：</h2><h3 id="标记chunk为可扩展"><a href="#标记chunk为可扩展" class="headerlink" title="标记chunk为可扩展"></a>标记chunk为可扩展</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br></pre></td><td class="code"><pre><span class="line">root@wei66:~# su - gbasedbt </span><br><span class="line">gbasedbt@wei66:~$ dbaccess sysadmin -</span><br><span class="line"></span><br><span class="line">数据库已被选用。</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_">&gt; </span><span class="language-bash">EXECUTE FUNCTION task(<span class="string">&quot;modify chunk extendable&quot;</span>, <span class="string">&quot;11&quot;</span>);</span>  </span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">(expression)  Chunk 11 is now extendable. </span><br><span class="line"></span><br><span class="line">查询到 1 行。</span><br><span class="line"></span><br><span class="line">Elapsed time: 0.202 sec</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_">&gt; </span><span class="language-bash"></span></span><br><span class="line"><span class="language-bash"></span></span><br><span class="line">数据库已关闭。</span><br><span class="line"></span><br><span class="line">gbasedbt@wei66:~$ onstat -d</span><br><span class="line"></span><br><span class="line">GBase Database Server Version 12.10.FC4G1AEE -- On-Line -- Up 00:11:04 -- 930724 Kbytes</span><br><span class="line"></span><br><span class="line">Dbspaces</span><br><span class="line">address          number   flags      fchunk   nchunks  pgsize   flags    owner    name</span><br><span class="line">4737f028         1        0x60001    1        1        2048     N  BA    gbasedbt rootdbs</span><br><span class="line">49b60dc8         2        0x40001    2        1        2048     N  BA    gbasedbt plogdbs</span><br><span class="line">4a193028         3        0x40001    3        1        2048     N  BA    gbasedbt llogdbs</span><br><span class="line">4a193258         4        0x42001    4        1        2048     N TBA    gbasedbt tempdbs01</span><br><span class="line">4a193488         5        0x42001    5        1        2048     N TBA    gbasedbt tempdbs02</span><br><span class="line">4a1936b8         6        0x42001    6        1        2048     N TBA    gbasedbt tempdbs03</span><br><span class="line">4a1938e8         7        0x42001    7        1        2048     N TBA    gbasedbt tempdbs04</span><br><span class="line">4a193b18         8        0x48001    8        1        2048     N SBA    gbasedbt sbspace01</span><br><span class="line">4a193d48         9        0x40001    9        1        2048     N  BA    gbasedbt datadbs01</span><br><span class="line">4a195028         10       0x40001    10       1        16384    N  BA    gbasedbt datadbs02</span><br><span class="line">4a195258         11       0x60001    11       1        2048     N  BA    gbasedbt dbs10</span><br><span class="line">4a195488         12       0x60001    12       1        2048     N  BA    gbasedbt dbs106</span><br><span class="line">4a1956b8         13       0x60001    13       1        2048     N  BA    gbasedbt dbs10r</span><br><span class="line"> 13 active, 2047 maximum</span><br><span class="line"></span><br><span class="line">Chunks</span><br><span class="line">address          chunk/dbs     offset     size       free       bpages     flags pathname</span><br><span class="line">4737f258         1      1      0          512000     498465                PO-B-D /data/g300/rootchk</span><br><span class="line">4a196028         2      2      0          512000     11947                 PO-B-D /data/g300/plogchk</span><br><span class="line">4a197028         3      3      0          512000     11947                 PO-B-D /data/g300/llogchk</span><br><span class="line">4a198028         4      4      0          512000     511947                PO-B-- /data/g300/tempchk01</span><br><span class="line">4a199028         5      5      0          512000     511947                PO-B-- /data/g300/tempchk02</span><br><span class="line">4a19a028         6      6      0          512000     511947                PO-B-- /data/g300/tempchk03</span><br><span class="line">4a19b028         7      7      0          512000     511947                PO-B-- /data/g300/tempchk04</span><br><span class="line">4a19c028         8      8      0          512000     451866     451868     POSB-D /data/g300/sbspace01</span><br><span class="line">                                 Metadata 60079      0          60079   </span><br><span class="line">4a19d028         9      9      0          512000     490456                PO-B-D /data/g300/datachk01</span><br><span class="line">4a19e028         10     10     0          6400       5809                  PO-B-D /data/g300/datachk02</span><br><span class="line">4a19f028         11     11     0          5120       0                     PO-BED /home/gbasedbt/dbs10</span><br><span class="line">4a1a0028         12     12     0          5120       0                     PO-B-D /home/gbasedbt/dbs106</span><br><span class="line">4a1a1028         13     13     0          5120       0                     PO-B-D /data/g300/rootchkdbs</span><br><span class="line"> 13 active, 32766 maximum</span><br><span class="line"></span><br><span class="line">NOTE: The values in the &quot;size&quot; and &quot;free&quot; columns for DBspace chunks are</span><br><span class="line">      displayed in terms of &quot;pgsize&quot; of the DBspace to which they belong.</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">Expanded chunk capacity mode: always</span><br><span class="line"></span><br><span class="line">gbasedbt@wei66:~$ </span><br></pre></td></tr></table></figure>

<h3 id="再次插入：成功"><a href="#再次插入：成功" class="headerlink" title="再次插入：成功"></a>再次插入：成功</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">dbaccess db10 &lt;&lt;!</span><br><span class="line">	create table t1 (id int);</span><br><span class="line">	insert into t1 values(1);</span><br><span class="line">!</span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">#</span><span class="language-bash">插入成功，且11号chunk自动扩容5000页：</span></span><br><span class="line">4a19e028         10     10     0          6400       5809                  PO-B-D /data/g300/datachk02</span><br><span class="line">4a19f028         11     11     0          10120      4992                  PO-BED /home/gbasedbt/dbs10</span><br><span class="line">4a1a0028         12     12     0          5120       0                     PO-B-D /home/gbasedbt/dbs106</span><br><span class="line">4a1a1028         13     13     0          5120       0                     PO-B-D /data/g300/rootchkdbs</span><br></pre></td></tr></table></figure>

<h3 id="测试结果：-4"><a href="#测试结果：-4" class="headerlink" title="测试结果："></a>测试结果：</h3><p>​		空间自动扩容。</p>
<h2 id="存储发放测试6：关闭sysadmin后自动扩容是否好使"><a href="#存储发放测试6：关闭sysadmin后自动扩容是否好使" class="headerlink" title="存储发放测试6：关闭sysadmin后自动扩容是否好使"></a>存储发放测试6：关闭sysadmin后自动扩容是否好使</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">dbaccess sysadmin &lt;&lt;!</span><br><span class="line">-- EXECUTE FUNCTION task(&quot;modify chunk extendable&quot;, &quot;11&quot;);  </span><br><span class="line">EXECUTE FUNCTION task(&quot;modify chunk extendable&quot;, &quot;12&quot;);</span><br><span class="line">EXECUTE FUNCTION task(&quot;modify chunk extendable&quot;, &quot;13&quot;);</span><br><span class="line">! </span><br><span class="line"></span><br><span class="line">touch $GBASEDBTDIR/etc/sysadmin/stop</span><br><span class="line">onmode -ky ; </span><br><span class="line">sleep 3;</span><br><span class="line">oninit -v;</span><br></pre></td></tr></table></figure>

<h3 id="再次插入：成功-1"><a href="#再次插入：成功-1" class="headerlink" title="再次插入：成功"></a>再次插入：成功</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">dbaccess db106 &lt;&lt;!</span><br><span class="line">	create table t1 (id int);</span><br><span class="line">	insert into t1 values(1);</span><br><span class="line">!</span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">gbasedbt@wei66:~$ onstat -g ath |grep -i work</span><br><span class="line">gbasedbt@wei66:~$ onstat -d |awk &#x27;$2==&quot;12&quot;&#x27;</span><br><span class="line">4a18f028         12     12     0          10120      4992                  PO-BED /home/gbasedbt/dbs106</span><br></pre></td></tr></table></figure>

<h3 id="测试结果：-5"><a href="#测试结果：-5" class="headerlink" title="测试结果："></a>测试结果：</h3><p>​		空间自动扩容。</p>
<p>​		</p>
<h2 id="存储发放测试7：SP-THRESHOLD-0"><a href="#存储发放测试7：SP-THRESHOLD-0" class="headerlink" title="存储发放测试7：SP_THRESHOLD 0"></a>存储发放测试7：SP_THRESHOLD 0</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">dbaccess sysadmin &lt;&lt;!</span><br><span class="line">EXECUTE FUNCTION task(&quot;modify chunk extendable off&quot;, &quot;13&quot;);</span><br><span class="line">EXECUTE FUNCTION task(&quot;modify chunk extendable&quot;, &quot;13&quot;);</span><br><span class="line">! </span><br><span class="line"></span><br><span class="line">onmode -wf SP_THRESHOLD=0</span><br><span class="line">onmode -ky ; </span><br><span class="line">sleep 3;</span><br><span class="line">oninit -v;</span><br></pre></td></tr></table></figure>

<h3 id="再次插入：成功-2"><a href="#再次插入：成功-2" class="headerlink" title="再次插入：成功"></a>再次插入：成功</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">dbaccess db10r &lt;&lt;!</span><br><span class="line">	create table t1 (id int);</span><br><span class="line">	insert into t1 values(1);</span><br><span class="line">!</span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">4a19f028         11     11     0          10120      4992                  PO-BED /home/gbasedbt/dbs10</span><br><span class="line">4a1a0028         12     12     0          10120      4992                  PO-BED /home/gbasedbt/dbs106</span><br><span class="line">4a1a1028         13     13     0          10120      4992                  PO-BED /data/g300/rootchkdbs</span><br></pre></td></tr></table></figure>

<h3 id="测试结果：-6"><a href="#测试结果：-6" class="headerlink" title="测试结果："></a>测试结果：</h3><p>​		空间自动扩容。</p>
<p>​		结论注明： 只要有sysadmin库存在即可。</p>
<h2 id="关于DBSpaces自动扩容的总结："><a href="#关于DBSpaces自动扩容的总结：" class="headerlink" title="关于DBSpaces自动扩容的总结："></a>关于DBSpaces自动扩容的总结：</h2><ol>
<li>自动扩容有两种，一种添加chunk，一种扩大chunk。</li>
<li>自动扩容第一步就是配置存储池。文件系统的chunk就不用配置存储池了，应为文件系统本身就是池。</li>
<li>需要sysadmin里面的api打开文件系统chunk的E开关。</li>
<li>sysadmin里面的任务可以stop不用启动，不会影响自动扩容。</li>
<li>SP_THRESHOLD可以设置为0，没有了要用到时再扩，不用事先监控并扩容。</li>
<li>sysadmin如果stop后，SP_THRESHOLD的task是不是也会不启作用了？</li>
<li>存储池的详细研究？</li>
</ol>
<p><strong>参考官方文档</strong>：</p>
<p><a target="_blank" rel="noopener" href="https://www.ibm.com/docs/en/informix-servers/12.10?topic=management-marking-chunk-as-extendable-not-extendable">修改chunk可自动扩容</a></p>
<p><a target="_blank" rel="noopener" href="https://www.ibm.com/docs/en/informix-servers/12.10?topic=management-manually-expanding-space-extending-extendable-chunk#ids_admin_1368">扩容dbs或扩容chunk的API</a></p>
<p><a target="_blank" rel="noopener" href="https://www.ibm.com/docs/en/informix-servers/12.10?topic=space-automatic-management">INFORMIX自动空间管理 指导</a></p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <div class="declare">
      <ul class="post-copyright">
        <li>
          <i class="ri-copyright-line"></i>
          <strong>Copyright： </strong>
          
          Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
          
        </li>
      </ul>
    </div>
    
    <footer class="article-footer">
       
<div class="share-btn">
      <span class="share-sns share-outer">
        <i class="ri-share-forward-line"></i>
        分享
      </span>
      <div class="share-wrap">
        <i class="arrow"></i>
        <div class="share-icons">
          
          <a class="weibo share-sns" href="javascript:;" data-type="weibo">
            <i class="ri-weibo-fill"></i>
          </a>
          <a class="weixin share-sns wxFab" href="javascript:;" data-type="weixin">
            <i class="ri-wechat-fill"></i>
          </a>
          <a class="qq share-sns" href="javascript:;" data-type="qq">
            <i class="ri-qq-fill"></i>
          </a>
          <a class="douban share-sns" href="javascript:;" data-type="douban">
            <i class="ri-douban-line"></i>
          </a>
          <!-- <a class="qzone share-sns" href="javascript:;" data-type="qzone">
            <i class="icon icon-qzone"></i>
          </a> -->
          
          <a class="facebook share-sns" href="javascript:;" data-type="facebook">
            <i class="ri-facebook-circle-fill"></i>
          </a>
          <a class="twitter share-sns" href="javascript:;" data-type="twitter">
            <i class="ri-twitter-fill"></i>
          </a>
          <a class="google share-sns" href="javascript:;" data-type="google">
            <i class="ri-google-fill"></i>
          </a>
        </div>
      </div>
</div>

<div class="wx-share-modal">
    <a class="modal-close" href="javascript:;"><i class="ri-close-circle-line"></i></a>
    <p>扫一扫，分享到微信</p>
    <div class="wx-qrcode">
      <img src="//api.qrserver.com/v1/create-qr-code/?size=150x150&data=http://example.com/2023/05/10/GBase8s%E5%85%B3%E4%BA%8EDBSpaces%E8%87%AA%E5%8A%A8%E6%89%A9%E5%AE%B9%E7%9A%84%E6%B5%8B%E8%AF%95/" alt="微信分享二维码">
    </div>
</div>

<div id="share-mask"></div>  
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E8%87%AA%E5%8A%A8%E6%89%A9%E5%AE%B9/" rel="tag">自动扩容</a></li></ul>

    </footer>
  </div>

   
  <nav class="article-nav">
    
      <a href="/2023/05/10/GBase8sjdbc%E8%BF%9E%E6%8E%A5%E4%B8%B2%E7%9B%B8%E5%85%B3/" class="article-nav-link">
        <strong class="article-nav-caption">上一篇</strong>
        <div class="article-nav-title">
          
            GBase8sjdbc连接串相关
          
        </div>
      </a>
    
    
      <a href="/2023/05/10/GBase8s%E5%86%85%E9%83%A8%E7%94%A8%E6%88%B7%E5%8F%AF%E7%94%A8%E9%99%90%E5%88%B6%E4%BC%9A%E8%AF%9D%E6%95%B0%E9%87%8F/" class="article-nav-link">
        <strong class="article-nav-caption">下一篇</strong>
        <div class="article-nav-title">GBase8s内部用户可用限制会话数量</div>
      </a>
    
  </nav>

  
   
  
    
</article>

</section>
      <footer class="footer">
  <div class="outer">
    <ul>
      <li>
        Copyrights &copy;
        2023-2024
        <i class="ri-heart-fill heart_icon"></i> Wang Wei
      </li>
    </ul>
    <ul>
      <li>
        
      </li>
    </ul>
    <ul>
      <li>
        
        
        <span>
  <span><i class="ri-user-3-fill"></i>Visitors:<span id="busuanzi_value_site_uv"></span></span>
  <span class="division">|</span>
  <span><i class="ri-eye-fill"></i>Views:<span id="busuanzi_value_page_pv"></span></span>
</span>
        
      </li>
    </ul>
    <ul>
      
    </ul>
    <ul>
      
    </ul>
    <ul>
      <li>
        <!-- cnzz统计 -->
        
      </li>
    </ul>
  </div>
</footer>    
    </main>
    <div class="float_btns">
      <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>

    </div>
    <aside class="sidebar on">
      <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ww.ico" alt="朝花夕拾"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="Search">
        <i class="ri-search-line"></i>
      </a>
      
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
    </aside>
    <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="/images/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="/images/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
    
<script src="/js/jquery-3.6.0.min.js"></script>
 
<script src="/js/lazyload.min.js"></script>

<!-- Tocbot -->
 
<script src="/js/tocbot.min.js"></script>

<script>
  tocbot.init({
    tocSelector: ".tocbot",
    contentSelector: ".article-entry",
    headingSelector: "h1, h2, h3, h4, h5, h6",
    hasInnerContainers: true,
    scrollSmooth: true,
    scrollContainer: "main",
    positionFixedSelector: ".tocbot",
    positionFixedClass: "is-position-fixed",
    fixedSidebarOffset: "auto",
  });
</script>

<script src="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.js"></script>
<link
  rel="stylesheet"
  href="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.css"
/>
<script src="https://cdn.staticfile.org/justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js"></script>

<script src="/dist/main.js"></script>

<!-- ImageViewer -->

<!-- MathJax -->

<!-- Katex -->

<!-- busuanzi  -->
 
<script src="/js/busuanzi-2.3.pure.min.js"></script>
 
<!-- ClickLove -->

<!-- ClickBoom1 -->

<!-- ClickBoom2 -->

<!-- CodeCopy -->
 
<link rel="stylesheet" href="/css/clipboard.css">
 <script src="https://cdn.staticfile.org/clipboard.js/2.0.10/clipboard.min.js"></script>
<script>
  function wait(callback, seconds) {
    var timelag = null;
    timelag = window.setTimeout(callback, seconds);
  }
  !function (e, t, a) {
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      $(".article pre code").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });
      clipboard.on('success', function(e) {
        let $btn = $(e.trigger);
        $btn.addClass('copied');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-checkbox-circle-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPIED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-checkbox-circle-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
      clipboard.on('error', function(e) {
        e.clearSelection();
        let $btn = $(e.trigger);
        $btn.addClass('copy-failed');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-time-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPY FAILED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-time-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
    }
    initCopyCode();
  }(window, document);
</script>
 
<!-- CanvasBackground -->

<script>
  if (window.mermaid) {
    mermaid.initialize({ theme: "forest" });
  }
</script>


    
    

  </div>
</body>

</html>